<!DOCTYPE html>
<html>
    <head>
      <meta charset="utf-8">
      <title>记录管理</title>
        <script src="../../layuilay/layui.js" charset="utf-8"></script>
    <script src="../../js/jquery-3.4.1.min.js" charset="utf-8"></script>
    <link rel="stylesheet" href="../../layuilay/css/layui.css"  media="all">
        
    </head>
    <body>
               <!-- 检索框开始———————————————————— -->
        <div class="layuimini-container">
            <div class="layuimini-main">
                <fieldset class="layui-elem-field layuimini-search">
                    <legend>搜索信息</legend>
                    <div style="margin: 10px 10px 10px 10px">
                        <form class="layui-form layui-form-pane" action="">
                            <div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">姓名</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="sdname" autocomplete="off"
                                            class="layui-input">
                                    </div>
                                 </div>
                                <div class="layui-inline"> 
                                    <label class="layui-form-label">状态</label>
                                    <div class="layui-input-inline">
                                        <input type="text" id="sstatus"  autocomplete="off"
                                            class="layui-input">
                                    </div>
                                <!-- </div>
                                <div class="layui-form-item"> -->
                                <div class="layui-inline">
                                  <label class="layui-form-label">进入时间</label>
                                  <div class="layui-input-inline" style="width: 100px;">
                                    <input type="text" id="startentertime" name="startentertime" placeholder="开始进入时间" autocomplete="off" class="layui-input">
                                  </div>
                                  <div class="layui-form-mid">-</div>
                                  <div class="layui-input-inline" style="width: 100px;">
                                    <input type="text" id="endentertime" name="endentertime" placeholder="结束进入时间" autocomplete="off" class="layui-input">
                                  </div>
                                </div>
                             
                                <div class="layui-inline">
                                  <label class="layui-form-label">离开时间</label>
                                  <div class="layui-input-inline" style="width: 100px;">
                                    <input type="text" id="startleavetime" name="startleavetime" placeholder="开始离开时间" autocomplete="off" class="layui-input">
                                  </div>
                                  <div class="layui-form-mid">-</div>
                                  <div class="layui-input-inline" style="width: 100px;">
                                    <input type="text" id="endleavetime" name="endleavetime" placeholder="结束离开时间" autocomplete="off" class="layui-input">
                                  </div>
                                </div>
                              </div>
                                
                                <div class="layui-inline">
                                    <button type="button" class="layui-btn layui-btn-normal layui-btn-radius" onclick="searchBtn()"><i class="layui-icon">&#xe615</i></button>
                                </div>
                            </div>
                        </form>
                    </div>
                </fieldset>
    
            <!-- 检索框结束 -->
            
            <table id="demo" lay-filter="test"></table>
            <script>
            layui.use('jquery',function(){
                var $=layui.$;
                $(function(){
                    searchBtn();
                        
                    })
            })
            function searchBtn(){
                   var sdname=$("#sdname").val();//姓名
                   var sstatus=$("#sstatus").val();//状态
                   var startentertime=$("#startentertime").val();//进入图书馆的开始时间
                   var endentertime=$("#endentertime").val();//进入图书馆的离开时间
                   var startleavetime=$("#startleavetime").val();//离开图书馆的开始时间
                   var endleavetime=$("#endleavetime").val();//离开图书馆的结束时间
layui.use(['table','laydate'], function(){
  var table = layui.table;
  var laydate=layui.laydate;
//日期时控件
  laydate.render({
        elem: '#startentertime'
        ,type: 'datetime'
      });
//日期时控件
  laydate.render({
        elem: '#endentertime'
        ,type: 'datetime'
      });
//日期时控件
  laydate.render({
        elem: '#startleavetime'
        ,type: 'datetime'
      });
//日期时控件
  laydate.render({
        elem: '#endleavetime'
        ,type: 'datetime'
      });
  table.render({
    elem: '#demo'
    ,url:'../../findByDetailedCondition'
        ,where:{
            dname:sdname,
            status:sstatus,
            startentertime:startentertime,
            endentertime:endentertime,
            startleavetime:startleavetime,
            endleavetime:endleavetime    
            }
    ,cols: [[
      {field:'did', title: 'ID', sort: true}
      ,{field:'personid',  title: '编号', sort: true}
      ,{field:'dname', title: '姓名'}
      ,{field:'status', title: '状态'}
      ,{field:'entertime', title: '进入时间'} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
      ,{field:'leavetime',  title: '离开时间'}
      
    ]]
  ,page: true
  });
});
            }
</script>
    </body>
</html>